package cn.aulang.study.ai.server.config;

import cn.aulang.study.ai.server.service.TimeService;
import cn.aulang.study.ai.server.service.UserInfoService;
import cn.aulang.study.ai.server.service.WeatherService;
import org.springframework.ai.support.ToolCallbacks;
import org.springframework.ai.tool.ToolCallback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * Tools配置
 *
 * @author Aulang
 */
@Configuration
public class ToolsConfig {

    @Bean
    public List<ToolCallback> toolCallbacks(@Autowired TimeService timeService,
                                            @Autowired WeatherService weatherService,
                                            @Autowired UserInfoService userInfoService) {
        return List.of(ToolCallbacks.from(timeService, weatherService, userInfoService));
    }
}
